package com.itheima.changeparamal;

import java.util.*;

public class unchangejihe {
    public static void main(String[] args) {
        arrayListTest();
        //Map.ofEntries(Entry<? extends K, ? extends V>... entries) 形参为可变参数
        TreeMap<String, String> tm = new TreeMap<>(Map.ofEntries(Map.entry("yy","anhui"),Map.entry("bb","beijing"),Map.entry("cc","shanghai")));
        tm.forEach((s1,s2)-> System.out.println(s1+s2));
    }

    private static void arrayListTest() {
        ArrayList<Integer> list = new ArrayList<Integer>(List.of(1,2,3,4,5,6));
        Iterator<Integer> iterator = list.iterator();
        while (iterator.hasNext()){{
            System.out.println(iterator.next());
        }
    }
    }
}
